package work20241206_chap7.n_demo11;

/**
 * @author zdl
 * @date 2024/12/5
 */
public class Square extends Rect {
    public Square(int a ,int b){
       super(a,b);
    }
    @Override
    public double area() {
        System.out.println("正方形面积" + (getA() * getB()));
        return getA() * getB();
    }

    @Override
    public double girth() {
        System.out.println("正方形周长:" + (2 * (getA() + getB())));
        return (2 * (getA() + getB()));
    }
}
